package controller

import (
	"gitee.com/crack007/udp-penetrate/src/api/service"
	"gitee.com/crack007/udp-penetrate/src/common/dto"
	"github.com/gin-gonic/gin"
)

type ClientController struct {
}

func (c *ClientController) Connect(ctx *gin.Context) interface{} {
	userDto := &dto.UserDto{}
	ctx.BindQuery(&userDto)
	return service.ClientService.Connect(userDto.Uid)
}

func (c *ClientController) SendMsg(ctx *gin.Context) interface{} {
	msgDto := &dto.MessageDto{}
	ctx.BindJSON(&msgDto)
	return service.ClientService.SendMsg(msgDto)
}
